package com.tfswue.group.controller;

import com.tfswue.group.service.EnventPublisherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/users")
public class RegestController {
    @Autowired
    private EnventPublisherService enventPublisher;

    @PostMapping("/api/rest/users")

    public ResponseEntity< String> registerUser(
            @RequestParam String username,
            @RequestParam String email) {
        enventPublisher.pubilshUserRegistered(username, email);
        return ResponseEntity.ok("用户注册成功");
    }

}